﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "IFamily2DSketchCurve.h"
#include "GmFamilyService.h"
#include "ElementCreationOptions.h"

namespace gfam
{
    /// \brief 草图直线的接口类
    class GM_FAMILY_SERVICE_EXPORT IFamily2DSketchLine : public gfam::IFamily2DSketchCurve
    {
        DEFINE_CAST_DERIVED(gfam::IFamily2DSketchLine, gfam::IFamily2DSketchCurve)
    public:

        /// \brief  创建草图直线
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  start 起点
        /// \param  end   末点
        /// \return 草图直线
        static IFamily2DSketchLine* Create(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, const gcmp::ElementId& sketchPlaneId, const gcmp::Vector3d&start, const gcmp::Vector3d&end);
       
        /// \brief  创建草图直线（轴线）
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  start 起点
        /// \param  end   末点
        /// \return 草图直线
        static IFamily2DSketchLine* CreateAsAxis(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, const gcmp::ElementId& sketchPlaneId, const gcmp::Vector3d&start, const gcmp::Vector3d&end);
        
        /// \brief  创建草图直线（参照线）
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  start 起点
        /// \param  end   末点
        /// \return 草图直线
        static IFamily2DSketchLine* CreateAsReference(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, const gcmp::ElementId& sketchPlaneId, const gcmp::Vector3d&start, const gcmp::Vector3d&end);
        
        /// \brief  创建草图直线（定位线）
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  start 起点
        /// \param  end   末点
        /// \return 草图直线
        static IFamily2DSketchLine* CreateAsLocationLine(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, const gcmp::ElementId& sketchPlaneId, const gcmp::Vector3d&start, const gcmp::Vector3d&end);

        /// \brief 获取直线的方向
        ///
        /// \return 方向
        virtual gcmp::Vector3d GetDirection() const = 0;

        /// \brief  设置直线
        ///
        /// \param  start 起点
        /// \param  end   末点
        virtual void SetLine(const gcmp::Vector3d& start, const gcmp::Vector3d& end) = 0;

        /// \brief 获取倒角斜线Id
        ///
        /// \return 倒角斜线Id
        virtual gcmp::ElementId GetChamferPointId() const = 0;

        /// \brief  设置倒角斜线Id
        ///
        /// \param  chamferPointId 倒角斜线Id
        virtual void SetChamferPointId(const gcmp::ElementId& chamferPointId) = 0;

        /// \brief 获得主对象（草图线）Id
        /// 主对象指具有强依赖关系的对象，当主对象被删除时，从对象也会被删除。
        ///
        /// \return ElementId 主对象（草图线）的Id
        virtual gcmp::ElementId GetMasterCurveId() const = 0;

        /// \brief 设置主对象（草图线）Id
        /// 主对象指具有强依赖关系的对象，当主对象被删除时，从对象也会被删除。
        ///
        /// \param masterId 主对象（草图线）Id
        /// \return void
        virtual void SetMasterCurveId(gcmp::ElementId masterCurveId) = 0;

    };
}